home *** CD-ROM | disk | FTP | other *** search
/ Ultra Gameplayers 101 / Ultra Game Players Magazine, No. 101 - September 1997 (Imagine Publishing, Inc.)(1997).iso / pc / new_ugp.dxr / 00201_Title Class.ls < prev    next >
Encoding:
Text File  |  1997-07-10  |  2.0 KB  |  75 lines

  1. property audioController, adBanner, clickSoundFX, volumeSprite, dataBase, currMenu, hotspotList, eventList, killList
  2.  
  3. on new me
  4.   put "Title Class frame:" && the frame
  5.   set killList to []
  6.   set hotspotList to []
  7.   set eventList to []
  8.   SetGlobal(#gTitleObject, me)
  9.   set audioController to new(script "Audio Controller Class")
  10.   NewVolumeControl(me, GetGlobal(#volumeButton))
  11.   set volumeSprite to GetGlobal(#volumeButton)
  12.   set clickSoundFX to NewObject(me, "Sound FX Class", [#audioMember: "ugpMouseClick"])
  13.   return me
  14. end
  15.  
  16. on CheckIdle me
  17.   set currCast to the mouseCast
  18.   set currLine to the mouseLine
  19.   set currSprite to GetHotSprite(currCast)
  20.   set setCursor to 0
  21.   repeat with obj in hotspotList
  22.     if CheckRoll(obj, currSprite, currLine) then
  23.       set setCursor to IsClickable(obj)
  24.     end if
  25.   end repeat
  26.   if CheckIdle(currMenu, currSprite, currLine) then
  27.     set setCursor to 1
  28.   end if
  29.   repeat with obj in eventList
  30.     CheckIdle(obj)
  31.   end repeat
  32.   if setCursor then
  33.     set cursMem to the number of member "hand cursor"
  34.     set matteMem to the number of member "hand cursor matte"
  35.     cursor([cursMem, matteMem])
  36.   else
  37.     cursor(-1)
  38.   end if
  39. end
  40.  
  41. on CheckMouseDowns me
  42.   set currCast to the mouseCast
  43.   set currLine to the mouseLine
  44.   set currSprite to GetHotSprite(currCast)
  45.   set destination to -1
  46.   repeat with obj in hotspotList
  47.     set myDest to CheckDown(obj, currSprite, currLine)
  48.     if myDest <> -1 then
  49.       set destination to myDest
  50.     end if
  51.   end repeat
  52.   set menuDest to CheckMouseDowns(currMenu, currSprite, currLine)
  53.   if menuDest <> -1 then
  54.     set destination to menuDest
  55.   end if
  56.   if destination > 0 then
  57.     KillAudio(audioController)
  58.     dispose(currMenu)
  59.     set currMenu to 0
  60.     if stringp(destination) then
  61.       if label(destination) > 0 then
  62.         go(destination)
  63.       else
  64.         go(1, destination)
  65.       end if
  66.     else
  67.       if integerp(destination) then
  68.         go(destination)
  69.       else
  70.         put "Error: destination is not string or integer--Where the hell are you trying to go?"
  71.       end if
  72.     end if
  73.   end if
  74. end
  75.